<%= javascript_include_tag 'jquery.sortable.js' %>

<%= javascript_include_tag 'sort_products.js' %>

<ol id='sort_ul'>
  <% if @products %>

    <% for product in @products %>
      <li class='sortableitem' id='<%=product.id%>'>
        <%=h product.name %>
        <%=h product.retail_price %>
      </li>
    <% end %>
  </ol>
  <div class="action_link">
    <button   onclick="print_ul('/products/update_sort_order');">保存顺序</button>
    <a href="/categories/<%=params[:id]%><%="/?brand_id=#{params[:brand_id]}" if params[:brand_id]%>" class="action_back">返回</a>
  </div>


<% end %>

<div style=""display:none id='hidden_form'>
  <%= form_tag('/categories')  %>
</div>